/*
 * @Author: your name
 * @Date: 2021-11-09 19:43:50
 * @LastEditTime: 2021-11-11 14:29:44
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\demo-work\src\utils\filterRouter.js
 */
const filterRouter = (allRouters, userInfo) => {
    const res = allRouters.filter((item) => {
        return item.meta.author.indexOf(userInfo) !== -1;
    });
    res.length > 0 &&
        res.forEach((item) => {
            if (item.children) {
                item.children = filterRouter(item.children, userInfo);
            }
        });
    return res;
};
export default filterRouter;